package pl.edu.mimuw.irs.rcp.controller.handler;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.gef.commands.CommandStack;
import org.eclipse.ui.handlers.HandlerUtil;

public class RedoHandler extends AbstractHandler {

	// *** Methods
	
	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {
		IAdaptable adaptable = HandlerUtil.getActivePart(event);
		CommandStack stack = (CommandStack) adaptable.getAdapter(CommandStack.class);
		if (stack != null) stack.redo();
		return null;
	}
}
